<template>
  <div class="card">
    <div class="card-title">
      {{ title }}
      <div class="more-wraper">
        <slot name="headerOpt" />
      </div>
    </div>
    <div class="card-body">
      <slot />
    </div>
  </div>
</template>

<script>
export default {
  name: 'Card',
  props: {
    title: {
      type: String,
      default: '标题'
    }
  }
}
</script>

<style lang="scss" scoped>
.card{
  height: 100%;
  width: 100%;
  .card-title{
    height: 31px;
    font-size: 14px;
    border: 1px solid #fff;
    border-bottom: none;
    line-height: 30px;
    color: #fff;
    text-indent: 10px;
    background: #5b8ecd;
    display: flex;
    align-items: center;
    .more-wraper{
      margin-left: auto;
      padding-right: 10px;
    }
  }
  .card-body{
    height: calc(100% - 31px);
  }
}
</style>
